﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using Kokomo.Environment.Hosting;
using Kokomo.PeInspector.Reflection;
using Kokomo.Environment;
using System.ComponentModel.Composition;

namespace AssemblyAnalyzer
{
	/// <summary>
	/// Interaction logic for App.xaml
	/// </summary>
	public partial class App : EditorApplication
	{
		protected override void OnStartup(StartupEventArgs e)
		{
			base.OnStartup(e);
		}

		protected override EditorHostWindow CreateMainWindow()
		{
			EditorHostWindow window = new EditorHostWindow();
			window.Title = Messages.MainWindowTitle;
			window.UseLayoutRounding = true;
			return window;
		}

		public AssemblyAnalyzerEditor AssemblyEditor { get; private set; }
		protected override void RegisterEditors()
		{
			//base.RegisterEditors();
			AssemblyAnalyzerEditor editor = new AssemblyAnalyzerEditor();
			this.Container.ComposeExportedValue(editor);
			this.AssemblyEditor = editor;
			this.RegisterEditor(editor);
		}

		protected override void RegisterDocumentTemplates()
		{
			//base.RegisterDocumentTemplates();

		}

		public override DocumentViewModel CreateNewDocument()
		{
			DocumentViewModel document = this.AssemblyEditor.CreateNew();
			return document;
		}
	}
}
